package com.example.transit.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.transit.R;
import com.example.transit.bean.CollectionBean;

import java.util.List;

public class CollectionAdapter extends BaseQuickAdapter<CollectionBean, BaseViewHolder> {
    public ImageView collect_img;
    public CollectionAdapter(int layoutResId, @Nullable List<CollectionBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CollectionBean item) {
        helper.addOnClickListener(R.id.collect_list_lly);
        helper.addOnClickListener(R.id.collect_list_img);
        collect_img=helper.getView(R.id.collect_list_img);
        collect_img.setSelected(true);
        helper.setText(R.id.collect_list_name, item.getLineNum()+"("+item.getName()+")");
    }
}
